/*======================================================================*\
|| #################################################################### ||
|| # vt.Lai Preload Popup 1.0                                         # ||
|| # ---------------------------------------------------------------- # ||
|| # Copyright ©2010-2012 Vu Thanh Lai. All Rights Reserved.          # ||
|| # Please do not remove this comment lines.                         # ||
|| # -------------------- LAST MODIFY INFORMATION ------------------- # ||
|| # Last Modify: 02-11-2011 12:10:00 PM by: Vu Thanh Lai             # ||
|| #################################################################### ||
\*======================================================================*/
/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*\
|*-------Please specify source when using my code or a part of them-----*|
\*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
/* 
var vtlaiPreloadConfig={
	'width':600,
	'closeText':'Close',
	'closeTitle':'Close this Box',
	'closeOption':'1',
	'content':'vt.Lai VBB Preload Popup by SinhVienIT.net'
}; */

	
jQuery(document).ready(function(){
	if(document.cookie.indexOf('vtlai_closePreloadPopup')==-1)
	{
		jQuery('body').append('<div id="preloadPopupOverlay" style="z-index:9998;background-color: rgba(0,0,0,0.4);display:block;width:100%;height:100%;position:fixed;top:0px;left:0px"></div>');
		jQuery('body').append('<div id="preloadPopupPoster" style="display:none;z-index:9999;border: 1px solid #CCC;background-color: #FFF;display:block;width:'+vtlaiPreloadConfig.width+'px;position:fixed;top:100px;left:-'+Math.floor(vtlaiPreloadConfig.width/2)+'px;margin-left:50%;"><h3 style="color: white;display: block;background-color: #0072BC;padding: 10px;text-align:right;"><a class="close" style="color:#FFF;" title="'+vtlaiPreloadConfig.closeTitle+'">'+vtlaiPreloadConfig.closeText+'</a></h3><div style="display: block;margin:5px;padding:0;" class="preloadPopupContent">'+vtlaiPreloadConfig.content+'</div></div>');
		jQuery('#preloadPopupPoster').fadeIn('fast',function(){
			jQuery('#preloadPopupOverlay,#preloadPopupPoster .close').click(function(){
				jQuery('#preloadPopupPoster').fadeOut('fast',function(){
					jQuery('#preloadPopupOverlay').fadeOut('fast',function(){
						jQuery('#preloadPopupPoster').remove();
						jQuery('#preloadPopupOverlay').remove();
						switch(vtlaiPreloadConfig.closeOption)
						{
							case '1':
								document.cookie='vtlai_closePreloadPopup=1;path=/';
								break;
							case '2':
								document.cookie='vtlai_closePreloadPopup=1;expires=Wed, 20 Aug 2036 21:23:14 GMT;path=/';
								break;
							case '3':
								break;
							default:
								document.cookie='vtlai_closePreloadPopup=1;path=/';
						}
					});
				})
			});
		});
		
	}
});